<?php
class Staticizer_News_Index_Advertisement extends Staticizer
{
    public function Build($param=NULL)
    {
        #参数处理
        $id=$param;
        $identifier='NEWS:INDEX:'.$id;

        #获取数据
        $data=DB::PGetRows('select Identifier,Path,URL from Advertisement where Identifier=? limit 0,1',array(
            $identifier
        ));
        $data[0]['Path']=Config::PATH_RELATIVE_ATTACHMENT_ADVERTISEMENT.'/news/'.$data[0]['Path'];

        #模板渲染
        View::Assign('Advertisement',$data[0]);

        #生成静态
        $this->Save('news/index/advertisement.'.$id.'.html',View::Fetch('news/index/advertisement.'.$id.'.tpl'));
    }
}
?>